06. Salting

Salting

Salting

ND035 C04 L01 A02.2 What Is Hashing

Let's consider a concrete example of what a salt might look like. First, suppose we have two users who have the same password: h3ll0. Here's what happens if we run those passwords through a hashing function:

User 1: h3ll0hash(h3ll0)qazx345y
User 2: h3ll0hash(h3ll0)qazx345y

As you can see, we end up with the same hashed value for both users. But if we first add a salt, the result is different:

User 1: h3ll0 → salt is tyuikjg → new password is h3ll0tyuikjg → hash is juyhtrg54
User 2: h3ll0 → salt is htyhrt → new password is h3ll0htyhrt → hash is jyt5yu75s

As you can see, even though both users have the same original password, the hashes are different after salting.

ND035 C04 L01 A03 Pictorial Represontation

What is a salt?

SOLUTION: Random data appended to a user’s password.